package com.fh.mappers;/**
 * 描述:
 * Author:袁亚强
 * Date:2021/11/1011:55
 */

import com.fh.entity.po.Area;
import com.fh.entity.po.Type;
import com.fh.entity.po.User;
import com.fh.entity.vo.UserVo;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;

/**
 * created by macro on 2021/11/10,
 */
@Mapper
public interface UserMapper {

    void addUser(User user);

    @Select("select * from t_user where name =#{name}")
    User queryByName(String name);

    @Select(" select * from t_area where pid = #{pid}")
    List<Area> queryAreaById(Integer pid);

    @Select("select * from t_user where id =#{id} ")
    User queryById(Integer id);

    @Update("update t_user set birthday=#{birthday},img=#{img},email=#{email} where id=#{id}")
    void updateUserById(User user);

    void batchDelUser(List list);

    @Delete("delete from t_user where id = #{id}")
    void deleteUser(Integer id);

    @Select("select * from t_area ")
    List<Area> queryAllArea();

    long queryCount(UserVo userVo);

    List<User> queryUserVo(UserVo userVo);

    @Select("select * from t_user ")
    List<User> queryUserAll(User user);

    @Select("select name from t_area where id=#{id}")
    String queryUserAreaName(Integer id);

    @Update(" update t_user set password=#{password} where id =#{id}")
    void updatePassword(User user);

    @Select("select * from t_user where id =#{id}")
    User queryPasswordById(User user);




}
